package com.webchat.connect;

import com.webchat.common.util.SpringContextUtil;
import com.webchat.connect.messagequeue.consumer.redis.ChatNotifyRedisQueueListener;
import com.webchat.rmi.annotation.EnableRpcPermissionFilter;
import com.webchat.rmi.annotation.EnableRpcPermissionInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan("com.webchat")
@SpringBootApplication
@EnableFeignClients("com.webchat.rmi")
@EnableRpcPermissionInterceptor
public class WebchatConnectApplication {

    public static void main(String[] args) {

        SpringApplication.run(WebchatConnectApplication.class, args);

        new Thread(() -> SpringContextUtil.getBean(ChatNotifyRedisQueueListener.class).consumeTask()).start();
    }

}
